package com.lkd.controller;

import com.lkd.base.BaseController;
import com.lkd.base.ResponseResult;
import com.lkd.service.FileUploadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController("/api/vm-service/sku/fileUpload")
@Api("文件上传相关接口")
public class FileUploadController extends BaseController {

    @Autowired
    FileUploadService fileUploadService;
    @PostMapping
    @ApiOperation("图片上传接口")
    public ResponseResult upload(@RequestParam("fileName") MultipartFile image) throws Exception {
        fileUploadService.upload(image);
        return success();
    }
}
